async function fn() {
  const promise = new Promise((resolve, reject) => {
    setTimeout(() => {
      if (Math.random() < 0.5) {
        resolve('正常')
      } else {
        reject('异常')
      }
    }, 1000)
  })

  try {
    const res = await promise
    console.log(res)
  } catch (error) {
    console.log(error)
  }
}

fn()
